<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_id}" for="id" />
                    <h:inputText id="id" value="#{customerController.selected.id}" title="#{bundle.CreateCustomerTitle_id}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_name}" for="name" />
                    <h:inputTextarea rows="4" cols="30" id="name" value="#{customerController.selected.name}" title="#{bundle.CreateCustomerTitle_name}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_surname}" for="surname" />
                    <h:inputTextarea rows="4" cols="30" id="surname" value="#{customerController.selected.surname}" title="#{bundle.CreateCustomerTitle_surname}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_surname}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_address}" for="address" />
                    <h:inputTextarea rows="4" cols="30" id="address" value="#{customerController.selected.address}" title="#{bundle.CreateCustomerTitle_address}" required="true" requiredMessage="#{bundle.CreateCustomerRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_createddate}" for="createddate" />
                    <h:inputText id="createddate" value="#{customerController.selected.createddate}" title="#{bundle.CreateCustomerTitle_createddate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_username}" for="username" />
                    <h:inputTextarea rows="4" cols="30" id="username" value="#{customerController.selected.username}" title="#{bundle.CreateCustomerTitle_username}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_password}" for="password" />
                    <h:inputTextarea rows="4" cols="30" id="password" value="#{customerController.selected.password}" title="#{bundle.CreateCustomerTitle_password}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_email}" for="email" />
                    <h:inputTextarea rows="4" cols="30" id="email" value="#{customerController.selected.email}" title="#{bundle.CreateCustomerTitle_email}" />
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_countyid}" for="countyid" />
                    <h:selectOneMenu id="countyid" value="#{customerController.selected.countyid}" title="#{bundle.CreateCustomerTitle_countyid}" >
                        <f:selectItems value="#{countyController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateCustomerLabel_cityid}" for="cityid" />
                    <h:selectOneMenu id="cityid" value="#{customerController.selected.cityid}" title="#{bundle.CreateCustomerTitle_cityid}" >
                        <f:selectItems value="#{citysController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{customerController.create}" value="#{bundle.CreateCustomerSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{customerController.prepareList}" value="#{bundle.CreateCustomerShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateCustomerIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
